{extend name="main"}
{block name="style"}
<style type="text/css">
	.el-input-group__prepend{padding: 0;}
	.el-input-group__prepend .el-cascader{line-height: 36px;min-width: 150px;}
	.el-input-group__prepend .el-input__inner{height: 36px;border: 0;}
    .search-bg{background-image: url(__TEMPLATE_STATIC__/home_searchbar_img_bg.png);background-size: 100% 100%;}
    .text-white a{color: #FFFFFF!important;}
</style>
{/block}
{block name="header"}
{include file="module/top_nav" container="container-xl"/}
{include file="module/header_concise"/}
{/block}
{block name="body"}
<div class="search-bg mb-3">
<div class="container-xl">
	<div class="search w-75 mx-auto py-5">
		<el-form @submit.native.prevent="setSearchItemKey" class="shadow">
			<el-input placeholder="请输入关键字" v-model="search.key" class="input-with-select el-input__inner-left-none"
			clearable>
			  	<el-cascader
				    v-model="cid"
				    :options="jobscatelist"
				    placeholder="职位分类"
				    :props="defaultProps"
				    filterable
				    clearable
				    :show-all-levels="false"
				     slot="prepend"
				     @change="setSearchItemCid">
			    </el-cascader>
			    <el-button native-type="submit" slot="append">搜索</el-button>
			</el-input>
		</el-form>
	</div>
</div>
</div>
<div class="container-xl position-relative text-666666">
	<div class="bg-white p-3">
		<div class="flex border-bottom">
			<div class="w-100px py-3">工作区域：</div>
			<div class="flex-1 overflow-hidden"
			:style="showAllCity?'height:auto;':'height:40px'">
				<div class="row" v-if="arealist">
					<div class="col-auto pr-3 py-3 pointer" :class="{'text-primary':(search.province==''&&search.city==''&&search.area=='')}" @click="setSearchItemCity('')">不限</div>
					<div class="col-auto pr-3 py-3 pointer" v-for="(v,index) in arealist" :class="{'text-primary':(search.province==v.id||search.city==v.id||search.area==v.id)}" @click="setSearchItemCity(v)">{{v.title}}</div>
				</div>
				<div class="row border-top" v-show="city.length">
					<div class="col-auto pr-3 py-3 pointer" v-for="(v,index) in city" :class="{'text-primary':search.city==v.id}" @click="setSearchItemCity(v)">{{v.title}}</div>
				</div>
				<div class="row border-top" v-show="area.length">
					<div class="col-auto pr-3 py-3 pointer" v-for="(v,index) in area" :class="{'text-primary':search.area==v.id}" @click="setSearchItemCity(v)">{{v.title}}</div>
				</div>
			</div>
			<div class="py-3 pointer" @click="showAllCity= !showAllCity;">更多<i class="el-icon-caret-top ml-2" v-if="showAllCity"></i><i class="el-icon-caret-bottom ml-2" v-else="showAllCity"></i></div>
		</div>
		<div class="flex flex-center border-bottom">
			<div class="w-100px">工作经验：</div>
			<div class="flex-1">
				<div class="row">
					<div class="col-auto pr-3 py-3 pointer" :class="{'text-primary':search.exp_level===0}" @click="setSearchItemExpLevel(0)">不限</div>
					<div class="col-auto pr-3 py-3 text-nowrap pointer" v-for="(v,index) in exp_level" :class="{'text-primary':search.exp_level===v.value}" @click="setSearchItemExpLevel(v.value)" v-if="v.value">{{v.title}}</div>
				</div>
			</div>
		</div>
		<div class="flex flex-center border-bottom">
			<div class="w-100px">年龄：</div>
			<div class="flex-1">
				<div class="row">
					<div class="col-auto pr-3 py-3 pointer" :class="{'text-primary':search.age===''}" @click="setSearchItemAge('')">不限</div>
					<div class="col-auto pr-3 py-3 text-nowrap pointer" v-for="(v,index) in age" :class="{'text-primary':search.age===v.value}" @click="setSearchItemAge(v.value)">{{v.title}}</div>
				</div>
			</div>
		</div>
		<div class="flex flex-center">
			<div class="w-100px">更多筛选：</div>
			<div class="mr-3 py-1 px-2 pointer border" :class="{'text-primary':search.educational_background}" @click="setShowSearchBody('educational_background')">学历要求
				<i class="el-icon-caret-top ml-2" v-if="showSearchBody=='educational_background'"></i>
				<i class="el-icon-caret-bottom ml-2" v-else></i>
			</div>
			<div class="mr-3 py-1 px-2 pointer border" :class="{'text-primary':search.nature_of_work}" @click="setShowSearchBody('nature_of_work')">工作性质
				<i class="el-icon-caret-top ml-2" v-if="showSearchBody=='nature_of_work'"></i>
				<i class="el-icon-caret-bottom ml-2" v-else></i>
			</div>
			<div class="mr-3 py-1 px-2 pointer border" :class="{'text-primary':search.salary_min&&search.salary_max}" @click="setShowSearchBody('salary')">期待薪资
				<i class="el-icon-caret-top ml-2" v-if="showSearchBody=='salary'"></i>
				<i class="el-icon-caret-bottom ml-2" v-else></i>
			</div>
			<div class="mr-3 py-1 px-2 pointer border" :class="{'text-primary':search.political_affiliation!==''}" @click="setShowSearchBody('political_affiliation')">政治面貌
				<i class="el-icon-caret-top ml-2" v-if="showSearchBody=='political_affiliation'"></i>
				<i class="el-icon-caret-bottom ml-2" v-else></i>
			</div>
			<div class="mr-3 py-1 px-2 pointer border" :class="{'text-primary':search.sex!==''}" @click="setShowSearchBody('sex')">性别要求
				<i class="el-icon-caret-top ml-2" v-if="showSearchBody=='sex'"></i>
				<i class="el-icon-caret-bottom ml-2" v-else></i>
			</div>
			<div class="mr-3 py-1 px-2 pointer border" :class="{'text-primary':search.update_time}" @click="setShowSearchBody('update_time')">更新时间
				<i class="el-icon-caret-top ml-2" v-if="showSearchBody=='update_time'"></i>
				<i class="el-icon-caret-bottom ml-2" v-else></i>
			</div>
			<div class="flex-1"></div>
			<div class="py-3 pointer" @click="clearSearchItem">清空筛选</div>
		</div>
	</div>
	<div class="search-item-body pb-4 container-xl" v-show="showSearchBody">
		<div class="bg-white shadow px-3 py-1">
			<div class="flex flex-center" v-if="showSearchBody=='educational_background'">
				<div class="w-100px">学历要求：</div>
				<div class="flex-1">
					<div class="row">
						<div class="col-auto pr-3 py-3 pointer" :class="{'text-primary':search.educational_background===''}" @click="setSearchItemEducationalBackground('')">不限</div>
						<div class="col-auto pr-3 py-3 text-nowrap pointer" v-for="(v,index) in educational_background" :class="{'text-primary':search.educational_background===v.value}" @click="setSearchItemEducationalBackground(v.value)">{{v.title}}</div>
					</div>
				</div>
			</div>
			<div class="flex flex-center" v-if="showSearchBody=='political_affiliation'">
				<div class="w-100px">政治面貌：</div>
				<div class="flex-1">
					<div class="row">
						<div class="col-auto pr-3 py-3 pointer" :class="{'text-primary':search.political_affiliation===''}" @click="setSearchItemPoliticalAffiliation('')">不限</div>
						<div class="col-auto pr-3 py-3 text-nowrap pointer" v-for="(v,index) in political_affiliation" :class="{'text-primary':search.political_affiliation===v.value}" @click="setSearchItemPoliticalAffiliation(v.value)">{{v.title}}</div>
					</div>
				</div>
			</div>
			<div class="flex flex-center" v-if="showSearchBody=='nature_of_work'">
				<div class="w-100px">工作性质：</div>
				<div class="flex-1">
					<div class="row">
						<div class="col-auto pr-3 py-3 pointer" :class="{'text-primary':search.nature_of_work===''}" @click="setSearchItemNatureOfWork('')">不限</div>
						<div class="col-auto pr-3 py-3 text-nowrap pointer" v-for="(v,index) in nature_of_work" :class="{'text-primary':search.nature_of_work===v.value}" @click="setSearchItemNatureOfWork(v.value)">{{v.title}}</div>
					</div>
				</div>
			</div>
			<div class="flex flex-center" v-if="showSearchBody=='salary'">
				<div class="w-100px">职位薪资：</div>
				<div class="row">
					<div class="col-auto pr-3 py-3 pointer" :class="{'text-primary':search.salary_min==''&&search.salary_max==''}" @click="setSearchItemSalary();">
						<span>不限</span>
					</div>
					<div class="col-auto pr-3 py-3 pointer" v-for="(v,index) in salary" :class="{'text-primary':search.salary_min==v.salary_min&&search.salary_max==v.salary_max}" @click="setSearchItemSalary(v);">
						<div v-if="jobs_salary_show_type">
							<span v-if="v.salary_min <= 0 && v.salary_max >=100">面议</span>
							<span v-else-if="v.salary_max>=100">{{v.salary_min}}元以上</span>
							<span v-else>{{v.salary_min}}-{{v.salary_max}}元</span>
						</div>
						<div v-else>
							<span v-if="v.salary_min <= 0 && v.salary_max >=100">面议</span>
							<span v-else-if="v.salary_max>=100">{{v.salary_min}}K以上</span>
							<span v-else>{{v.salary_min}}-{{v.salary_max}}K</span>
						</div>
					</div>
				</div>
			</div>
			<div class="flex flex-center" v-if="showSearchBody=='sex'">
				<div class="w-100px">性别要求：</div>
				<div class="flex-1">
					<div class="row">
						<div class="col-auto pr-3 py-3 text-nowrap pointer" v-for="(v,index) in sex" :class="{'text-primary':search.sex===v.value}" @click="setSearchItemSex(v.value)">{{v.title}}</div>
					</div>
				</div>
			</div>
			<div class="flex flex-center" v-if="showSearchBody=='update_time'">
				<div class="w-100px">更新时间：</div>
				<div class="flex-1">
					<div class="row">
						<div class="col-auto pr-3 py-3 pointer" :class="{'text-primary':search.update_time===''}" @click="setSearchItemUpdateTime('')">不限</div>
						<div class="col-auto pr-3 py-3 text-nowrap pointer" v-for="(v,index) in update_time" :class="{'text-primary':search.update_time===v.value}" @click="setSearchItemUpdateTime(v.value)">{{v.title}}</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<div class="container-xl py-3">
	<div class="flex">
		<div class="flex-1 pr-3">
			<div class="bg-white flex px-3 flex-center shadow text-666666">
				<div class="px-4 py-2 pointer border-bottom border-white border-lg"
				:class="{'border-primary text-primary':search.is_famous==0}"
				@click="setSearchItemIsFamous(0)">所有简历</div>
				<!-- <div class="px-4 py-2 pointer border-bottom border-white border-lg"
				:class="{'border-primary text-primary':search.is_famous==1}"
				@click="setSearchItemIsFamous(1)">优质简历</div> -->
				<div class="flex-1"></div>
				<div class="px-4 pointer" 
				:class="{'text-primary':search.prop=='default'}" 
				@click="setSearchItemProp('default')">综合排序<i class="el-icon-bottom ml-2 font-weight-bold"></i></div>
				<div class="px-4 pointer" 
				:class="{'text-primary':search.prop=='update_time'}" 
				@click="setSearchItemProp('update_time')">更新时间<i class="el-icon-bottom ml-2 font-weight-bold"></i></div>
				<div class="border-left px-4">{{search.current_page}} / {{search.last_page}}</div>
				<div class="px-4 pointer"
				@click="listViewType= !listViewType">{{listViewType?'详情':'列表'}}</div>
			</div>
			<div v-if="!listViewType">
				<div class="mt-3 bg-white" v-if="list.length>0" v-for="(v,index) in list">
					<div class="flex p-4">
						<div class="w-100px">
							<img :src="v.headimg" width="80" height="80" class="rounded-circle">
						</div>
						<div class="flex-1 pr-3">
							<a href="javascript:void(0);" @click="hrefPage('/resume/'+v.id+'.html')">
								<div class="h6 text-0143B1">{{v.name}}<span class="text-secondary ml-2 small">发布于{{v.friendly_time}}</span></div>
							</a>
							<div class="text-secondary flex flex-center">
								<div>{{v.educational_background}}</div>
								<div class="py-1 border-left mx-1"></div>
								<div>{{v.work_experience_time?v.work_experience_time+'年':'无'}}工作经验</div>
								<div class="py-1 border-left mx-1" v-if="v.nature_of_work"></div>
								<div>{{v.nature_of_work}}</div>
							</div>
						</div>
						<div class="flex-1">
							<div class="h6" v-if="v.employment_intention.length">{{v.employment_intention.join('、')}}</div>
							<div v-if="v.industry">{{v.industry}}</div>
							<div v-else>行业不限</div>
							<div class="text-secondary flex flex-center">
								<div>{{v.job_city?v.job_city:'地区不限'}}</div>
								<div class="py-1 border-left mx-1"></div>
								<div v-if="v.salary_min" class="text-ec6334">
									<span v-if="v.jobs_salary_show_type">{{v.salary_min}}-{{v.salary_max}}元</span>
									<span v-else>{{v.salary_min}}-{{v.salary_max}}k</span>
								</div>
								<div v-else class="text-ec6334">面议</div>
								<div class="py-1 border-left mx-1" v-if="v.job_status"></div>
								<div>{{v.job_status}}</div>
							</div>
						</div>
						<div class="pl-3">
							<el-button type="success" icon="el-icon-chat-dot-round" @click="IMvm.applyToUserContacts(getImContactsUserData(v));">立即沟通</el-button>
							<div class="text-center pt-2 pointer" @click="toggleResumeCollection(v)" v-if="v.is_collection"><i class="el-icon-star-on mr-1"></i>取消收藏</div>
							<div class="text-center pt-2 pointer" @click="toggleResumeCollection(v)" v-if="!v.is_collection"><i class="el-icon-star-off mr-1"></i>收藏</div>
						</div>
					</div>
					<div class="px-4 py-2 bg-white flex" v-if="v.self_description||v.specialty_label.length">
						<div class="w-100px"></div>
						<div class="flex-1">
							<el-tag type="info" size="mini" v-for="(specialty_label,index) in v.specialty_label" v-if="index<6" class="mr-2">{{specialty_label}}</el-tag>
						</div>
						<div class="flex-1 text-secondary text-truncate">{{v.self_description}}</div>
						<div class="w-100px"></div>
					</div>
				</div>
			</div>
			<el-table
		      :data="list"
		      style="width: 100%"
		      class="mt-3"
      		  header-cell-class-name="bg-light"
		      v-else>
		      <el-table-column
		        prop="title"
		        label="姓名"
		        width="100">
		        <template slot-scope="scope">
				<a href="javascript:void(0);" @click="hrefPage('/resume/'+scope.row.id+'.html')" class="h6 text-0143B1">
					{{scope.row.name}}
				</a>
		        </template>
		      </el-table-column>
		      <el-table-column
		        label="基本资料">
		        <template slot-scope="scope">
				<div class="text-secondary flex flex-center">
					<div>{{scope.row.educational_background}}</div>
					<div class="py-1 border-left mx-1"></div>
					<div>{{scope.row.work_experience_time?scope.row.work_experience_time+'年':'无'}}工作经验</div>
					<div class="py-1 border-left mx-1" v-if="scope.row.nature_of_work"></div>
					<div>{{scope.row.nature_of_work}}</div>
				</div>
		        </template>
		      </el-table-column>
		      <el-table-column
		        prop="job_city"
		        label="区域"
		        width="80">
		        <template slot-scope="scope">
				{{scope.row.job_city?scope.row.job_city:'地区不限'}}
		        </template>
		      </el-table-column>
		      <el-table-column
		        prop="job_title"
		        label="期望职位"
		        width="120">
		      </el-table-column>
		      <el-table-column
		        prop="friendly_time"
		        label="发布时间"
		        width="160">
		      </el-table-column>
		      <el-table-column
		        label="操作"
		        width="120">
		        <template slot-scope="scope">
					<el-button type="success" size="mini" icon="el-icon-chat-dot-round" @click="IMvm.applyToUserContacts(getImContactsUserData(scope.row));">立即沟通</el-button>
		        </template>
		      </el-table-column>
		    </el-table>
			<div class="p-3 text-center text-secondary" v-if='list.length<=0&&!listViewType'>暂无数据</div>
			<div class="mt-3" v-if="retmsg&&(retmsg==='resume_vague0'||retmsg==='resume_vague1'||retmsg==='resume_vague2')">
				<div
				class="p-5 text-v-center"
				style="background-image: url(__TEMPLATE_STATIC__/search_resume_bg.png);background-repeat: no-repeat;background-size: 100%;height: 480px">
					<div v-if="retmsg==='resume_vague0'">
						<h3>成为企业会员，高效挑选人才！</h3>
						<div class="text-secondary">登录或注册后可以查看更多简历信息~</div>
						<div class="mx-auto login-tabs position-relative py-4 text-center wrap h-100">
							<div class="flex1 text-v-center">
								<img v-if="qrloginImgUrl" :src="qrloginImgUrl" alt="" width="60%">
							</div>
							<div class="position-absolute pt-5"
							style="background-color: rgba(0,0,0,.45);left: 0;top: 0;right: 0;bottom: 0;z-index: 100;"
							v-if="loginTabs.scanQrSuccess">
								<div class="text-center pt-5">
									<i class="el-icon-check text-success h1"></i>
								</div>
								<div class="text-center text-white">扫码成功</div>
							</div>
							<div class="text-small text-secondary mt-3">请使用{xycms:web name="name"}APP扫码登录</div>
						  	<div class="flex text-small text-secondary mt-3 flex-v-center">
							    <div class="text-secondary">登录代表你已同意</div>
							  	<div class="pl-2">
							  		<a href="/article/content/user_agreement_web.html" class="el-link el-link--primary" target="_blank">《网页版服务协议》</a>
							    </div>
						    </div>
						</div>
						<div>
							<a href="/register" class="el-button el-button--danger"
							target="_blank">
								<span class="text-white">注册会员</span>
							</a>
							<a href="/login" class="el-button el-button--primary"
							target="_blank">
								<span class="text-white">登录账号</span>
							</a>
						</div>
					</div>
					<div class="py-5" v-if="retmsg==='resume_vague1'">
						<h3>成为企业会员，高效挑选人才！</h3>
						<div class="pt-5">
							<a href="javascript:void(0);"
							@click="goToCompany" class="el-button el-button--danger">
								<span class="text-white">身份切换</span>
							</a>
						</div>
					</div>
					<div class="py-5" v-if="retmsg==='resume_vague2'">
						<h3>发布职位后才能查看简历</h3>
						<div class="pt-5">
							<a href="/user/jobs/release" class="el-button el-button--primary"
							target="_blank">
								<span class="text-white">去发布</span>
							</a>
						</div>
					</div>
				</div>
			</div>
			<div class="text-center mt-3 bg-white py-3" v-if='list.length>0'>
				<el-pagination
				  background
				  @current-change="handleCurrentChange"
				  layout="prev, pager, next"
			      :page-size="search.per_page"
				  :total="search.total">
				</el-pagination>
			</div>
		</div>
		<div class="w-350px">
			<div class="ads">
				{xycms:ads alias="search_resume" name='v' length='3'}
		      	<div class="text-v-center shadow mb-3">
		      		{empty name="v.url"}
			      	<a title="{$v.title}" class="{$v.ads_icon?'ads-icon':''}">
		      		{else/}
			      	<a href="{$v.url}" class="s {$v.ads_icon?'ads-icon':''}" target="_blank" title="{$v.title}">
		      		{/empty}
						<img src="{xycms:web name="imgurl"/}{$v.path}" class="w-350px">
			      	</a>
		      	</div>
				{/xycms:ads}
			</div>
			{xycms:jobslist name="JobsList" new="1"}
			<div class="bg-white p-3 shadow">
				<div class="block-title-before pb-2">最新职位</div>
				{volist name="JobsList" id="v"}
				<a href="/jobs/{$v.id}.html" target="_blank" class="flex py-3 flex-center">
					<div class="border w-80px h-80px text-truncate rounded-lg">
						<img src="{$v.logo}" style="object-fit: contain;width: 100%;height: 100%;">
					</div>
					<div class="flex-1 pl-2">
						<h6 class="mb-1 text-secondary text-truncate">{$v.title}</h6>
						<div class="h6 text-ec6334 mb-3">
							{gt name="v.salary_min" value="0"}
							{eq name="v.jobs_salary_show_type" value="1"}
							{$v.salary_min}-{$v.salary_max}元
							{else/}
							{$v.salary_min}-{$v.salary_max}k
							{/eq}
							{else/}
							面议
							{/gt}
						</div>
						<div class="text-secondary flex">
							<div class="flex-1 text-truncate">
						{empty name="v.company_name"}
						{$v.company_name}
						{else/}
						{$v.scompany_name}
						{/empty}
					</div>
							<div>{$v.jobs_city}</div>
						</div>
					</div>
				</a>
				{/volist}
			</div>
			{/xycms:jobslist}
		</div>
	</div>	
</div>
{/block}
{block name="footer"}
{include file="module/footer"/}
{include file="module/login"/}
{include file="module/buy_win"/}
{/block}
{block name="script"}
<script type="text/javascript">
	var salary=[
		{salary_min:0,salary_max:100},
		{salary_min:1,salary_max:3},
		{salary_min:3,salary_max:5},
		{salary_min:5,salary_max:10},
		{salary_min:10,salary_max:20},
		{salary_min:20,salary_max:50},
		{salary_min:50,salary_max:100},
		];
	var sex=[
		{value:'',title:'不限'},
		{value:1,title:'男'},
		{value:2,title:'女'},
	];
	var jobscatelist={xycms:jobscate serialize="json"/};
	var arealist={xycms:arealist serialize="json"/};
	var educational_background={xycms:statusalias name="resume/educational_background" serialize="json"/};
	var political_affiliation={xycms:statusalias name="resume/political_affiliation" serialize="json"/};
	var nature_of_work={xycms:statusalias name="resume/nature_of_work" serialize="json"/};
	var exp_level={xycms:statusalias name="jobs/exp_level" serialize="json"/};
	var age={xycms:statusalias name="resume/age" serialize="json"/};
</script>
<script type="text/javascript">
	var vm=new Vue({
		el:'#app',
		data:{
			view:XYBase.view,
			loginTabs:XYBase.loginTabs,
			userInfo:UserInfo,
			feedback:XYBase.feedback,
			confirm:0,
			jobs_salary_show_type:{xycms:companyconfig name="jobs_salary_show_type"/},
			hoverCityKey:'A',
			showSearchBody:'',
			qrloginImgUrl:'',
			showAllCity:false,
			listViewType:false,
			buy:XYBase.buy,
			cid:[],
			xy_score:{
				recharge_rate:{xycms:scoreconfig name="recharge_rate"},
				is_integer:{xycms:scoreconfig name="is_integer"},
				proportion:{xycms:scoreconfig name="proportion"},
			},
			arealist:arealist,
			city:[],
			area:[],
			jobscatelist:jobscatelist,
	        defaultProps: {
	          	value: 'id',
	          	label: 'title',
	          	children: 'data',
	        },
			age:age,
			salary:salary,
			educational_background:educational_background,
			political_affiliation:political_affiliation,
			nature_of_work:nature_of_work,
			exp_level:exp_level,
			update_time:[{value:1,title:'今天以内'},{value:2,title:'三天以内'},{value:3,title:'七天以内'}],
			retmsg:'',
			search:{
				ajax:false,
				cid:{empty name=":request()->get('cid')"}0{else/}{:request()->get('cid')}{/empty},
				key:'{notempty name=":request()->get('key')"}{:request()->get('key')}{/notempty}',
				city:{empty name=":request()->get('area')"}''{else/}{:request()->get('area')}{/empty},
				salary_min:{empty name=":request()->get('salary_min')"}''{else/}{:request()->get('salary_min')}{/empty},
				salary_max:{empty name=":request()->get('salary_max')"}''{else/}{:request()->get('salary_max')}{/empty},
				sex:'',
				age:'',
				political_affiliation:'',
				educational_background:{empty name=":request()->get('education_level')"}''{else/}{:request()->get('education_level')}{/empty},
				nature_of_work:{empty name=":request()->get('nature_of_work')"}''{else/}{:request()->get('nature_of_work')}{/empty},
				exp_level:{empty name=":request()->get('exp_level')"}0{else/}{:request()->get('exp_level')}{/empty},
				update_time:'',
				is_famous:0,
				prop:'default',
				per_page:10,
				current_page:0,
				last_page:0,
				total:0,
				page:1
			},
			list:[]
		},
		watch:{
		    view:XYBase.viewWatch,
		    loginTabs:XYBase.loginTabsWatch,
		    listViewType(val,oldVal){
		    	if(val){
		    		XYBase.setCookie('resumeListViewType',1);
		    	}else{
		    		XYBase.delCookie('resumeListViewType');
		    	}
		    }
		},
		created(){
			XYBase.created(this);
			this.listViewType=XYBase.getCookie('resumeListViewType')?true:false;
			this.initHtml();
		},
		methods:XYBase.methods({
			hrefPage(url){
				if(this.userInfo.id){
					window.open(url);
				}else{
					return this.loginTabs.loginWin=true;
				}
			},
			setSearchItemCid(val){
				if (val) {
					this.search.cid=val[2];
				}else{
					this.search.cid='';
				}
				this.search.page=1;
				this.initHtml();
			},
			getImContactsUserData(row){
				return {touid:row.uid,nickname:row.name,headimg:row.headimg,jobs_id:0}
			},
			setSearchItemSalary(obj){
				if(obj){
					this.search.salary_min=obj.salary_min;
					this.search.salary_max=obj.salary_max;
				}else{
					this.search.salary_min='';
					this.search.salary_max='';
				}
				this.search.page=1;
				this.initHtml();
			},
			setSearchItemWorkExperienceTime(val){
				this.search.work_experience_time=val;
				this.search.page=1;
				this.initHtml();
			},
			setSearchItemCity(val){
			    this.search.province='';
			    this.search.city='';
			    this.search.area='';
			    if(val){
			        switch(val.level){
			            case 1:
				        this.search.province=val.id;
				        this.city=val.data;
			    		this.area=[];
			            break;
			            case 2:
				        this.search.city=val.id;
				        this.area=val.data;
			            break;
			            case 3:
				        this.search.area=val.id;
			            break;
			        }
			    }else{
			    	this.city=[];
			    	this.area=[];
			    }
				this.search.page=1;
				this.initHtml();
			},
			setSearchItemSex(val){
				this.search.sex=val;
				this.search.page=1;
				this.initHtml();
			},
			setSearchItemAge(val){
				this.search.age=val;
				this.search.page=1;
				this.initHtml();
			},
			setSearchItemEducationalBackground(val){
				this.search.educational_background=val;
				this.search.page=1;
				this.initHtml();
			},
			setSearchItemPoliticalAffiliation(val){
				this.search.political_affiliation=val;
				this.search.page=1;
				this.initHtml();
			},
			setSearchItemNatureOfWork(val){
				this.search.nature_of_work=val;
				this.search.page=1;
				this.initHtml();
			},
			setSearchItemExpLevel(val){
				this.search.exp_level=val;
				this.search.page=1;
				this.initHtml();
			},
			setSearchItemUpdateTime(val){
				this.search.update_time=val;
				this.search.page=1;
				this.initHtml();
			},
			setSearchItemKey(){
				this.search.page=1;
				this.initHtml();
			},
			setSearchItemProp(val){
				this.search.prop=val;
				this.search.page=1;
				this.initHtml();
			},
			setSearchItemIsFamous(val){
				this.search.is_famous=val;
				this.search.page=1;
				this.initHtml();
			},
			setShowSearchBody(el){
				if (el==this.showSearchBody) {
					this.showSearchBody='';
				}else{
					this.showSearchBody=el;
				}
			},
			clearSearchItem(){
				this.search.page=1;
				this.search.salary_min=0;
				this.search.salary_max=100;
				this.search.key='';
				this.search.city='';
				this.search.sex='';
				this.search.age='';
				this.search.educational_background='';
				this.search.political_affiliation='';
				this.search.nature_of_work='';
				this.search.exp_level=0;
				this.search.update_time='';
				this.showSearchBody='';
				this.initHtml();
			},
			handleCurrentChange(val){
				this.search.page=val;
				this.initHtml();
			},
			initHtml(){
				var _this=this;
				if (_this.search.ajax) return XYBase.msg('操作频繁，请稍后再试');
				_this.search.ajax=true;
				_this.sendGet({
					url:'/search/resume',
					data:_this.search
				},function(ret){
					_this.search.ajax=false;
					if (ret) {
						_this.list=[];
						if (ret.code === 0) {
							_this.retmsg=ret.msg;
							_this.search.total=ret.data.total;
							_this.search.per_page=ret.data.per_page;
							_this.search.current_page=ret.data.current_page;
							_this.search.last_page=ret.data.last_page;
							_this.list=ret.data.data;
						}else{
							_this.retmsg=ret.msg;
							_this.search.current_page=0;
							_this.search.last_page=0;
						}
					}
				});
			},
			openNewBuy(val){
	    		document.body.style="overflow: hidden;padding-right:17px;";
	    		this.buy.title='下载简历';
	    		this.buy.stitle='下载'+val.name+'简历';
				this.buy.pay_status='download-resume';
	    		this.buy.form.pay_type='';
	    		this.buy.form.type=11;
	    		this.buy.form.alias_id=val.id;
	    		this.buy.price=val.price;
	    		this.buy.data=val;
	    		this.buy.data.title=this.buy.title;
	    		this.buy.view=true;
				this.getScoreOrderPrice();
			},
			orderPaySuccess(val) {
				if (val.otrade===this.buy.orderInfo.otrade)
					this.buy.pay_status='success';
				if (this.buy.orderTimeEr)
					clearInterval(this.buy.orderTimeEr);
			},
			downloadsResume(row){
				var _this=this;
				const loading=XYBase.openloading();
				_this.sendPost({
					url:'/downloads/resume/'+row.id+'?confirm='+_this.confirm,
				},function(ret) {
		        	_this.confirm=0;
					loading.close();
					if (ret) {
						if (ret.code === 0) {
							if (ret.data.type=='download') {
								XYBase.success(ret.msg);
								window.open("{xycms:web name='url'}/downloads/resume/"+ret.data.id);
							}else if(ret.data.type=='pay'){
								ret.data.name=row.name;
								_this.openNewBuy(ret.data);
							}
						}else if(ret.code === 200){
							_this.$confirm(ret.msg, '提示', {
								dangerouslyUseHTMLString:true,
					          	confirmButtonText: '确定',
					          	cancelButtonText: '取消',
					          	type: 'warning'
					        }).then(() => {
					        	_this.confirm=1;
					        	_this.downloadsResume(row);
					        }).catch(() => {
					        });
						}else{
							XYBase.msg(ret.msg);
						}
					}
				});
			}
		})
	});
</script>
{/block}